<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>校园破冰交友与失物招领平台-个人信息</title>
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <link rel="stylesheet" type="text/css" href="../assets/css/bootstrap.min.css">
    <link rel="stylesheet" type="text/css" href="../assets/fonts/line-icons.css">
    <link rel="stylesheet" type="text/css" href="../assets/css/main.css">
    <link rel="stylesheet" type="text/css" href="../assets/css/responsive.css">
</head>
<body>
<div class="container-fluid">
    <div class="breadcrumb-wrapper row">
        <div class="col-12 col-lg-3 col-md-6">
            <h4 class="page-title">我的个人信息</h4>
        </div>
        <div class="col-12 col-lg-9 col-md-6">
            <ol class="breadcrumb float-right">
                <li class="active">个人信息</li>
                <li class="active"> / 我的个人信息</li>
            </ol>
        </div>
    </div>
</div>
<div class="container-fluid">
    <div class="row">
        <div class="col-12 grid-margin">
            <div class="card">
                <div class="card-body">
                    <form class="form-sample">
                        <p class="card-description">个人信息</p>
                        <div class="row">
                            <div class="col-md-6" id="userMessage">
                                <div class="form-group row">
                                    <label class="col-sm-3 col-form-label">账号</label>
                                    <div class="col-sm-9">
                                        <label id="username"></label>
                                    </div>
                                </div>
                                <div class="form-group row">
                                    <label class="col-sm-3 col-form-label">昵称</label>
                                    <div class="col-sm-9">
                                        <label id="nickname"></label>
                                    </div>
                                </div>
                                <div class="form-group row">
                                    <label class="col-sm-3 col-form-label">个性签名</label>
                                    <div class="col-sm-9">
                                        <label id="introduce"></label>
                                    </div>
                                </div>
                                <div class="form-group row">
                                    <label class="col-sm-3">性别</label>
                                    <div class="col-sm-9">
                                        <label id="sex"></label>
                                    </div>
                                </div>
                                <div class="form-group row">
                                    <label class="col-sm-3 col-form-label">学校</label>
                                    <div class="col-sm-9">
                                        <label id="school"></label>
                                    </div>
                                </div>
                                <div class="form-group row" id="facultyDiv">
                                    <label class="col-sm-3 col-form-label">学院</label>
                                    <div class="col-sm-9">
                                        <label id="faculty"></label>
                                    </div>
                                </div>
                                <div class="form-group row" id="userClassDiv">
                                    <label class="col-sm-3 col-form-label">班级</label>
                                    <div class="col-sm-9">
                                        <label id="class"></label>
                                    </div>
                                </div>
                            </div>
                            <div class="col-md-6">
                                <div class="text-center">
                                    <img id="profilePhoto" src="" alt='user-img' class='img-circle' width="400px" height="400px" style='border-radius:50%'/>
                                </div>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
<script src="../assets/js/jquery-min.js"></script>
<script>
    $(function () {
        var user = window.parent.user;

        $("#username").text(user.username);
        $("#profilePhoto").attr("src", user.profilePhoto);
        $("#nickname").text(user.nickname);
        $("#introduce").text(user.introduce);
        $("#sex").text(user.sex);
        $("#school").text(user.school);
        $("#faculty").text(user.faculty);
        $("#class").text(user.userClass);
		
		if(user.role==1){
			$("#userClassDiv").hide();
		}else if(user.role==2){
			$("#facultyDiv").hide();
			$("#userClassDiv").hide();
		}
		
		if(user.isPass=='0'){
			$("#userMessage").append("<p>信息审核中</p>");
		}else if(user.isPass=='1'){
			$("#userMessage").append("<p>信息审核通过</p>");
		}else{
			$("#userMessage").append("<p>信息审核未通过</p>");
		}
    })
</script>
</body>
</html>